package com.rd.student.ruanjian.class4.gaoyiming;

import java.util.Objects;

public class Student {
    private String name;
    private String major;
    private String classNumber;

    public Student() {
    }

    public Student(String name, String major, String classNumber) {
        this.name = name;
        this.major = major;
        this.classNumber = classNumber;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getMajor() {
        return major;
    }

    public void setMajor(String major) {
        this.major = major;
    }

    public String getClassNumber() {
        return classNumber;
    }

    public void setClassNumber(String classNumber) {
        this.classNumber = classNumber;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Student student = (Student) o;
        return Objects.equals(name, student.name) &&
                Objects.equals(major, student.major) &&
                Objects.equals(classNumber, student.classNumber);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, major, classNumber);
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", major='" + major + '\'' +
                ", classNumber='" + classNumber + '\'' +
                '}';
    }
}
